#pragma once
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>
#include "Xps/Util/concurrent_queue.h"
#include "Xps/Packet/IPacket.h"

namespace Xps
{
    namespace asio = boost::asio;
    namespace ip = boost::asio::ip;
    using namespace boost::asio::ip;

    class IProtocol abstract
    {
    public:
        typedef boost::shared_ptr<IProtocol> Ptr;
        typedef concurrent_queue<IPacket::Ptr> concurrent_out_queue;
        typedef concurrent_queue<IObject::Ptr> concurrent_in_queue;

        __event void OnPacketRecieved(const std::string &_ProtocolName, const IObject *_Object);

        virtual const std::string & getName() const = 0;
        virtual void Start() = 0;
        virtual void Stop() = 0;
        virtual void Send(IPacket::Ptr _Packet) = 0;
        virtual ~IProtocol(void){}

    };
};